package com.itheima.pattern.decorator

/**
 * @version v1.0
 * @ClassName: Client
 * @Description: TODO(一句话描述该类的功能)
 * @Author: 黑马程序员
 */
object Client {
    @JvmStatic
    fun main(args: Array<String>) {
        //点一份炒饭
        var food: FastFood = FriedRice()
        println(food.desc + "  " + food.cost() + "元")
        println("===============")

        //在上面的炒饭中加一个鸡蛋
        food = Egg(food)
        println(food.desc + "  " + food.cost() + "元")
        println("================")
        //再加一个鸡蛋
        food = Egg(food)
        println(food.desc + "  " + food.cost() + "元")
        println("================")
        food = Bacon(food)
        println(food.desc + "  " + food.cost() + "元")
    }
}